<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SC Transportes - Cadastro Usuário</title>
#{set 'moreStyles'}
        #{stylesheet 'main.css' /}
#{/set}
#{get 'moreStyles' /}
</head>

<body>

	<div id="wrapper">

        <div id="logomarca">
        </div><!-- #logomarca-->
        
        <div id="titleBar">
            Relatorio > <span>Clientes</span>
        <a class="sair" href="@{Application.index()}">Sair</a> </div><!-- #titleBar -->
        
        <div id="content">
        		<div style="color: green; font-weight: bold; text-align: center;">
	        		${msgInformation != null ? msgInformation : ''}
	        	</div>
	        	
	        	<!-- Filtro de relatorio -->
	        	<div style="width: 680px; margin-bottom: 20px;">
	        		<table width="600" cellpadding="0" cellspacing="5">
	        		<form action="@{ClienteApplication.relatorioCliente()}" method="post">
	        			<tr>
		                    <td valign="top">Cliente Origem:</td>
		                    <td>
			        			<select name="idClienteOrigem">
			        				<option value="">SELECIONE</option>
			        				#{list items:clientes, as:'cliente'}
			        					<option value="${cliente.id}">${cliente.empresa}</option>
			        				#{/list}
			        			</select>
			        		</td>
	        			</tr>
	        			
	        			<tr>
		        			<td valign="top">Cliente Destino:</td>
		        			<td>
			        			<select name="idClienteDestino">
			        				<option value="">SELECIONE</option>
			        				#{list items:clientes, as:'cliente'}
			        					<option value="${cliente.id}">${cliente.empresa}</option>
			        				#{/list}
			        			</select>
		        			</td>
	        			</tr>
	        			
	        			<tr>
	        				<td valign="top">Status da Entrega</td>
	        				<td>
			        			<select name="Status">
			        				<option value="">SELECIONE</option>
			        				<option value="Definida">Definida</option>
			        				<option value="Indefinida">Indefinida</option>
			        			</select>
			        		</td>
	        			</tr>
	        			
	        			<tr>
	        				<td><input type="submit" class="button" value="Buscar" name="Buscar" />
			        			<a href="@{Application.cancelar()}">
									<input type="button" class="button" value="Cancelar" />
								</a>
							</td>
						</tr>
	        		</form>
	        		</table>
	        	</div>
	        	
	        	#{if entregas != null}
	            <table class="listagem" width="680" cellpadding="0" cellspacing="1" align="center">
	            	<tr>
	            		<th>Entrega</th>
	            		<th>Cliente Origem</th>
	            		<th>Cliente Destino</th>
	            		<th>Funcionário</th>
	            		<th>Código para Rastreio</th>
	            		<th>Volumes</th>
	            		<th>Valor</th>
	            		<th>Viagem</th>
	            	</tr>
	            	#{list items:entregas, as:'entrega'}
		                <tr class="${entrega_index % 2 ? 'corForte' : ''}">
		                    <td style="text-align: center;">${entrega.descricao}</td>
		                    <td style="text-align: center;">${entrega.idClienteOrigem.empresa} - ${entrega.idClienteOrigem.cnpj}</td>
		                    <td style="text-align: center;">${entrega.idClienteDestino.empresa} - ${entrega.idClienteDestino.cnpj}</td>
		                    <td style="text-align: center;">${entrega.idFuncionario.usuario.nome}</td>
		                    <td style="text-align: center;">${entrega.codRastreio}</td>
		                    <td style="text-align: center;">${entrega.volumes}</td>
		                    <td style="text-align: center;">${entrega.valor}</td>
		                    <td style="text-align: center;">${entrega.viagem != null ? 'DEFINIDA' : 'INDEFINIDA'}</td>
		                </tr>
	                #{/list}
	            </table>
	            #{/if}
        </div><!-- #content -->
      
        <div id="footer">
        	2012 - SC Transporte - Todos os direitos reservados
        </div><!-- #footer -->
        
	</div><!-- #wrapper -->

</body>
</html>